package com.ganzalang.gmall.customannotation.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @description:
 * @author: Ganzalang
 * @Date 2021/4/2 19:25
 */
@Aspect
@Component
@Slf4j
public class TokenAspect {

    @Pointcut("@annotation(com.ganzalang.gmall.customannotation.annotation.ValidateToken)")
    public void annotationPointcut() {

    }

    @Around("annotationPointcut()")
    public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
        log.info("日志切面打印：{}", new Date());
        return joinPoint.proceed();
    }



}
